package com.fjut.controller;


import com.fjut.model.user.UserInfo;
import com.fjut.result.Result;
import com.fjut.service.UserInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 用户表 前端控制器
 * </p>
 *
 * @author DengTianxun
 * @since 2023-03-09
 */
@Api(tags = "用户接口")
@RestController
@RequestMapping("/fjut/user/userInfo")
public class UserInfoController {

    @Autowired
    private UserInfoService userInfoService;

    @ApiOperation("获取用户信息")
    @GetMapping("getUserInfoById/{id}")
    public UserInfo getUserInfoById(@PathVariable Long id){
        return userInfoService.getById(id);
    }

    @ApiOperation("获取所有用户信息")
    @GetMapping("getAllUserInfo")
    public List<UserInfo> getAllUserInfo(){
        return userInfoService.list();
    }
}

